x86/hvm: make sure emulation is retried if domain is shutting down
authorPaul Durrant <paul.durrant@citrix.com>
Tue, 7 Jul 2015 12:40:04 +0000 (14:40 +0200)
committerJan Beulich <jbeulich@suse.com>
Tue, 7 Jul 2015 12:40:04 +0000 (14:40 +0200)
commit0c0cbf72cf9f28070cc5d49955b0a00df5c1d114
tree925f4539651572186aa0ef59630899bcb3f4aee7
parentd1370961810d3b1630e0ad5e28e5cfc8dcfe2b9b
x86/hvm: make sure emulation is retried if domain is shutting down

The addition of commit 2df1aa01 "x86/hvm: remove hvm_io_pending() check
in hvmemul_do_io()" causes a problem in migration because I/O that was
caught by the test of vcpu_start_shutdown_deferral() in
hvm_send_assist_req() is now considered completed rather than requiring
a retry.

This patch fixes the problem by having hvm_send_assist_req() return
X86EMUL_RETRY rather than X86EMUL_OKAY if the
vcpu_start_shutdown_deferral() test fails and then making sure that
the emulation state is reset if the domain is found to be shutting
down.

Reported-by: Don Slutz <don.slutz@gmail.com>
Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
xen/arch/x86/hvm/emulate.c
xen/arch/x86/hvm/hvm.c